﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using System.ComponentModel;

namespace Oroboros.Save_Data
{
    public class DefenceSaveData : INotifyPropertyChanged
    {
        private Guid _Guid;
        private Guid _ParentGuid;

        private string _CompletedModel;
        private string _DefenceClassName;
        private bool _IsUnderConstruction;
        private Vector3 _Position = Vector3.Zero;
        private Quaternion _Rotation = Quaternion.Identity;

        public Guid Guid { get { return _Guid; } set { Changed("Guid"); _Guid = value; } }
        public Guid ParentGuid { get { return _ParentGuid; } set { Changed("ParentGuid"); _ParentGuid = value; } }

        public string CompletedModel { get { return _CompletedModel; } set { Changed("CompletedModel"); _CompletedModel = value; } }
        public string DefenceClassName { get { return _DefenceClassName; } set { Changed("DefenceClassName"); _DefenceClassName = value; } }
        public bool IsUnderConstruction { get { return _IsUnderConstruction; } set { Changed("IsUnderConstruction"); _IsUnderConstruction = value; } }
        public Vector3 Position { get { return _Position; } set { Changed("Position"); _Position = value; } }
        public Quaternion Rotation { get { return _Rotation; } set { Changed("Rotation"); _Rotation = value; } }

        public event PropertyChangedEventHandler PropertyChanged;
        public void Changed(string n)
        {
            if (PropertyChanged == null) return;
            if (!string.IsNullOrEmpty(n))
                PropertyChanged(this, new PropertyChangedEventArgs(n));
        }

         public override string ToString()
        {
            return string.Format("Defence {0}", DefenceClassName);
        }
   }
}
